//
//  CourseModel.m
//  Edu_iOS2018
//
//  Created by yanyan on 2018/1/6.
//  Copyright © 2018年 yanyan. All rights reserved.
//

#import "CourseModel.h"
#import "CYDataHelper.h"
@implementation CourseModel
- (instancetype)initWithObject:(id)obj{
    if (self = [super init]) {
        self.modelId = [CYDataHelper isNull:[obj valueForKey:@"id"]]?@"":[obj valueForKey:@"id"];
        self.title = [CYDataHelper isNull:[obj valueForKey:@"title"]]?@"":[obj valueForKey:@"title"];
        self.pictureUrl = [obj valueForKey:@"picture"];
        self.num = [CYDataHelper isNull:[obj valueForKey:@"num"]]?@"":[obj valueForKey:@"num"];
        self.price = [CYDataHelper isNull:[obj valueForKey:@"price"]]?@"":[obj valueForKey:@"price"];
        if ([obj valueForKey:@"teacher"]) {
            self.teacher = [obj valueForKey:@"teacher"];
        }
        self.status = [CYDataHelper isKindOfClass:[obj valueForKey:@"status"]]?@"":[obj valueForKey:@"status"];
    }
    return self;
}

@end
